import Vue from 'vue'
import App from './App'
// import uView from "uview-ui"
import store from './store'
import uniPopupMessage from '@/components/uni-popup/uni-popup-message.vue'
import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
import uniPopupShare from '@/components/uni-popup/uni-popup-share.vue'
import uniPopupPhone from '@/components/uni-popup/uni-popup-phone.vue'
import uniPopupPayFor from '@/components/uni-popup/uni-popup-payfor.vue'
import uniPopupDel from '@/components/uni-popup/uni-popup-del.vue'
import buyDialog from '@/components/uni-popup/buy-dialog.vue'
import callOnline from '@/components/uni-popup/call-online.vue'
import uniPopupApply from '@/components/uni-popup/apply.vue'
import uniPopupUp from '@/components/uni-popup/up.vue'
import HttpCache from './api/cache'
// Vue.use(uView);
Vue.component('uni-popup-message', uniPopupMessage)
Vue.component('uni-popup-dialog', uniPopupDialog)
Vue.component('uni-popup-share', uniPopupShare)
Vue.component('uni-popup-phone', uniPopupPhone)
Vue.component('uni-popup-payfor', uniPopupPayFor)
Vue.component('uni-popup-del', uniPopupDel)
Vue.component('uni-popup-apply', uniPopupApply)
Vue.component('uni-popup-up', uniPopupUp)
Vue.component('buy-dialog',buyDialog)
Vue.component('call-online',callOnline)
Vue.config.productionTip = false
import request from './api/config.js' 
Vue.prototype.$store = store

const prePage = ()=>{
	let pages = getCurrentPages();
	let prePage = pages[pages.length - 2];
	// #ifdef H5
	return prePage;
	// #endif
	return prePage.$vm;
}
Vue.prototype.$http = request
Vue.prototype.$SysCache = HttpCache
Vue.prototype.$api = { prePage }
App.mpType = 'app'

const app = new Vue({
	store,
	...App
})
app.$mount()
